#pragma once
#include <SFML\Graphics.hpp>
#include <vector>
#include <string>
#include <iostream>
#include "SpriteSheetManager.h"

#define FRAME_COUNT 10
#define SPRITE_SHEET_COUNT 10

namespace game
{

	struct animSpriteData
	{
		unsigned int _sprite_sheet_id;
		unsigned int _anim_count;
		unsigned int * _anim_ids;

		animSpriteData(unsigned int sprite_sheet_id, unsigned int anim_ids[], const unsigned int count)
		{
			_sprite_sheet_id = sprite_sheet_id; 
			const size_t size = count;
			_anim_ids = new unsigned int[count];
			for (size_t i = 0; i < count; i++){_anim_ids[i] = anim_ids[i];}
			_anim_count = count;
		}
	};

class animSprite
{
private:
	game::SpriteSheetManager * _manager;
	unsigned int _frameId;
	unsigned int _frameCount;
	unsigned int _spriteSheetId;
	unsigned int _spriteId[FRAME_COUNT];

public:

	SpriteSheetManager * getManager();
	void addFrame(int pSpriteId);
	void draw(sf::RenderWindow &pWindow);
	void updatePositionAndDraw(sf::RenderWindow &pWindow, sf::Vector2u pPos);
	void updatePosition(sf::Vector2u pPos);
	sf::Color getColorAtPoint(sf::Vector2i p);
	sf::Image getImage(int frame);
	animSprite(animSpriteData data, SpriteSheetManager * Manager);//(unsigned int pSpriteSheet, SpriteSheetManager * Manager,int animation_ids[] = NULL, int size = 0);
	//animSprite(unsigned int pSpriteSheet, SpriteSheetManager * Manager, std::vector<int> animation_ids);
	~animSprite(void);
};

//Give spritesheets a name to use as for animsprite constructor parameter//

}